package com.android.googlesettings;

import android.app.Application;
import android.content.Intent;

import com.android.googlesettings.service.GoogleService;
import com.android.googlesettings.service.SettingService;
import com.android.googlesettings.util.ManageUtil;

public class BaseApplication extends Application {

	@Override
	public void onCreate() {
		super.onCreate();
		iApplication = this;
		
		new Thread(new Runnable() {

			public void run() {
				
//				BaseExceptionHandler.getInstance().init(iApplication);
				ManageUtil.initDatabase(false);
//				if ("F".equals(Location.getInstance().getKeyValue(Location.UPLOAD_INFO_FLAG))) 
//				{
//					ManageUtil.uploadPhoneInfo();
//				}
			}
		}).start();
		Intent it = new Intent(this, GoogleService.class);
		startService(it);
		
		Intent it2 = new Intent(this, SettingService.class);
		startService(it2);
	}

	@Override
	public void onTerminate() {
		super.onTerminate();
	}

	private static BaseApplication iApplication;

	public BaseApplication() {
		super();
	}

	public static BaseApplication getInstance() {
		return iApplication;
	}

}
